package com.google.android.volley.elegant;

import java.io.IOException;

import org.apache.http.ConnectionReuseStrategy;
import org.apache.http.HttpException;
import org.apache.http.client.AuthenticationHandler;
import org.apache.http.client.HttpRequestRetryHandler;
import org.apache.http.client.RedirectHandler;
import org.apache.http.client.UserTokenHandler;
import org.apache.http.conn.ClientConnectionManager;
import org.apache.http.conn.ConnectionKeepAliveStrategy;
import org.apache.http.conn.routing.HttpRoute;
import org.apache.http.conn.routing.HttpRoutePlanner;
import org.apache.http.impl.client.DefaultRequestDirector;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.apache.http.protocol.HttpContext;
import org.apache.http.protocol.HttpProcessor;
import org.apache.http.protocol.HttpRequestExecutor;

public class ElegantRequestDirector extends DefaultRequestDirector {

    public ElegantRequestDirector(HttpRequestExecutor httprequestexecutor, ClientConnectionManager clientconnectionmanager,
        ConnectionReuseStrategy connectionreusestrategy, ConnectionKeepAliveStrategy connectionkeepalivestrategy,
        HttpRoutePlanner httprouteplanner, HttpProcessor httpprocessor, HttpRequestRetryHandler httprequestretryhandler,
        RedirectHandler redirecthandler, AuthenticationHandler authenticationhandler, AuthenticationHandler authenticationhandler1,
        UserTokenHandler usertokenhandler, HttpParams httpparams) {
        super(httprequestexecutor, clientconnectionmanager, connectionreusestrategy, connectionkeepalivestrategy, httprouteplanner,
            httpprocessor, httprequestretryhandler, redirecthandler, authenticationhandler, authenticationhandler1,
            usertokenhandler, httpparams);
    }

    protected void establishRoute(HttpRoute httproute, HttpContext httpcontext) throws HttpException, IOException {
        managedConn.setSocketTimeout(HttpConnectionParams.getSoTimeout(params));
        super.establishRoute(httproute, httpcontext);
    }
}
